;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

/*
Objective(s):-
	- To display the appropriate MessageBox when the cursor is on relevant
	  Part/Line/Field
	- To understand the event 'On Focus'

Capabilities Used:-
	- Event 'On Focus'

Syntax -
	- On : <Event>	: <Logical Condition> : <Action>	: <Action Parameters>
	- On : Focus	: <Logical Condition> : <Action>	: <Action Parameters>

Updaion History:-
	- Created on 20-4-2010
*/

[Function: OnFocus Sales Voucher]

	Variable	: IsOnFocusDemo	: Logical	: Yes
	Variable	: Info Msg		: String	: "This code demonstrates the usage of Event 'On Focus' at various Interface Objects"

	00	: Create: OnFocus Sales Voucher

[Report: OnFocus Sales Voucher]

	Use		: Voucher
	Form	: Voucher
	Set 	: SVVoucherType		: Sales
	Set 	: InvoicingModeFlag : Yes

;; To print the Info Message for user

[#Form: VCHBASIC Form]

	Option	: VCHBASIC Form On Focus	: ##IsOnFocusDemo

	[!Form: VCHBASIC Form On Focus]

		Add		: Parts : Before		: VCH Title	: Form SubTitle
		Local	: Field	: Form SubTitle	: Info		: ##InfoMsg

;; On Focus at Part

[#Part: EI InvInvoice]
	
	On 	: Focus		: @@IsSales	AND ##IsOnFocusDemo : CALL	: PartLevelFocusFunc
	
[Function: PartLevelFocusFunc]

	00	: MSGBOX	: "Part Level Focus"	: "You are about to enter the Inventory Entries Part"

;; On Focus at Line

[#Line: VCH Narration]

	On	: Focus		: @@IsSales	AND ##IsOnFocusDemo : CALL 	: NarrFunc

[Function: NarrFunc]

	00 	: MSGBOX	: "Line Level Focus"	: "Please enter remarks, \n if any"

;; On Focus at Field

[#Line: EI Consignee]

	Option	: On Focus EI Consignee	: @@IsSales	AND ##IsOnFocusDemo

	[!Line: On Focus EI Consignee]

		Add		: Right Fields : At Beginning 	: Medium Prompt, Sales Man Name
		Local	: Field : Medium Prompt	: Info  : "SalesMan :"

		[Field: Sales Man Name]

			Use 	: Name Field
			On		: Focus	: Yes		: CALL 	: Func Sales Man Name

[Function: Func Sales Man Name]

	00 : MSGBOX		: "Field Level Focus"	: "Please enter \n Salesman Name"

;; End-of-File
